package dome8;

/**
 *
 *   Object类是所有类的父类
 *
 */



class Porson {}

class Studen {}

class Dog {
    public void fun1() {}
    public void fun2() {}
    public void fun3() {}

}


public class Test {

    public static void func(Object obj) {}

    public static void main(String[] args) {
        func(new Porson()); // 匿名对象，缺点：每次使用都得new，使用场景：只用一次！
        func(new Studen());
        func(new Dog());
        new Dog().fun1();
        new Dog().fun2();
        new Dog().fun3();

        System.out.println("============");

        Dog dog = new Dog();
        dog.fun1();
        dog.fun2();
        dog.fun3();

    }

}
